<?php
/**
 * Created by PhpStorm.
 * User: liujialiang
 * Date: 2017/9/20
 * Time: 15:48
 */

namespace app;


class Controller
{
    public function getRoute(){
        $url = preg_replace('/\?.*/', '', $_SERVER['REQUEST_URI']);
        $route = substr($url, strpos($url, '/') + 1);
        $segment = strrchr(ROOT_DIR, DIRECTORY_SEPARATOR) . '/public/';
        $route = substr($url, strlen($segment));
        return $route;
    }
}